<?php
/**
 * Created by PhpStorm.
 * User: changshuiwang
 * Date: 2016/7/22
 * Time: 14:20
 */
namespace common\service;
use Yii;

class BaseSrv
{
    public static $instance = array();

    public function __construct()
    {
    }

    //获取实例
    static public function getInstance() {

        $class = get_called_class();

        if(self::$instance === null || !isset(self::$instance[$class])) {
            self::$instance[$class] = new $class;
        }

        return self::$instance[$class];
    }
}